package com.mohan.system.manage.service.impl;

import com.google.common.collect.Maps;
import com.mohan.system.manage.service.IShiroService;
import org.apache.shiro.spring.web.ShiroFilterFactoryBean;
import org.springframework.stereotype.Service;

import java.util.Map;


/**
 * @author mohan
 */
@Service(value = "ShiroServiceImpl")
public class ShiroServiceImpl implements IShiroService {
    @Override
    public Map<String, String> loadFilterChainDefinitionMap() {
        Map<String,String> filterChainDefinitionMap = Maps.newLinkedHashMap();

        // 设置不认证就可以访问
        filterChainDefinitionMap.put("/manage/user/login","anon");
        filterChainDefinitionMap.put("/manage/user/register","anon");
        filterChainDefinitionMap.put("/logout","logout");

        filterChainDefinitionMap.put("/**","authc");

        return filterChainDefinitionMap;
    }

    @Override
    public void updatePermission(ShiroFilterFactoryBean shiroFilterFactoryBean, Integer roleId, Boolean isRemoveSession) {

    }
}
